//
//  RXFrameAlert.h
//  RXFrame
//
//  Created by srxboys on 2021/4/21.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^CancelHandler)(void);
typedef void(^DismissHandler)(NSUInteger buttonIndex); // index默认从0开始

@interface RXFrameAlert : NSObject

@property (nonatomic, copy) NSString * title;
@property (nonatomic, copy) NSString * message;
@property (nonatomic, copy) NSString * cancelButtonTitle;
@property (nonatomic, copy) NSArray * otherButtonTitles;

@property (nonatomic, copy) CancelHandler cancelHandler;
@property (nonatomic, copy) DismissHandler dismissHandler;

- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles;
- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles cancelHandler:(CancelHandler)cancelHandler dismissHandler:(DismissHandler)dismissHandler;

// 配合上面
- (void)show;




+ (void)showAlertWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles cancelHandler:(CancelHandler)cancelHandler dismissHandler:(DismissHandler)dismissHandler;

@end

NS_ASSUME_NONNULL_END
